
#if	defined( MODEL_AGC5030 ) || defined ( MODEL_AGC505X )
#define ROM_BLOCK0     (0xF0000)
#define ROM_BLOCK0_END ((unsigned far *)0xFFFFE)
#define ROM_BLOCK1     (0xE0000)
#define ROM_BLOCK1_END ((unsigned far *)0xEFFFE)
#define ROM_BLOCK2     (0xD0000)
#define ROM_BLOCK2_END ((unsigned far *)0xDFFFE)
#define ROM_BLOCK3     (0xC0000)
#define ROM_BLOCK3_END ((unsigned far *)0xCFFFE)
#define ROM_BLOCK4     (0xB0000)
#define ROM_BLOCK4_END ((unsigned far *)0xBFFFE)
#define ROM_BLOCK5     (0xA0000)
#define ROM_BLOCK5_END ((unsigned far *)0xAFFFE)
#define ROM_BLOCK6     (0x90000)
#define ROM_BLOCK6_END ((unsigned far *)0x9FFFE)
#define ROM_BLOCK7     (0x80000)
#define ROM_BLOCK7_END ((unsigned far *)0x8FFFE)
#else
#define ROM_BLOCK0     (0xF0000)
#define ROM_BLOCK0_END ((unsigned far *)0xF7FFE)
#define ROM_BLOCK1     (0xF8000)
#define ROM_BLOCK1_END ((unsigned far *)0xF9FFE)
#define ROM_BLOCK2     (0xFA000)
#define ROM_BLOCK2_END ((unsigned far *)0xFBFFE)
#define ROM_BLOCK3     (0xFC000)
#define ROM_BLOCK3_END ((unsigned far *)0xFDFFE)
#define ROM_BLOCK4     (0xFE000)
#define ROM_BLOCK4_END ((unsigned far *)0xFEFFE)
#define ROM_BLOCK5     (0xFF000)
#define ROM_BLOCK5_END ((unsigned far *)0xFFFFE)
#define ROM_BLOCK6     (0xE0000)
#define ROM_BLOCK6_END ((unsigned far *)0xEFFFE)
#define ROM_BLOCK7     (0xD0000)
#define ROM_BLOCK7_END ((unsigned far *)0xDFFFE)
#define ROM_BLOCK8     (0xC0000)
#define ROM_BLOCK8_END ((unsigned far *)0xCFFFE)
#endif

unsigned char BOOT_FlashWrite(unsigned short far *write_addr, unsigned short *write_data, unsigned short usCnt);
void BOOT_EraseAllBlock(void);



